package com.rays.sysmech.ui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;

import javax.swing.JButton;
import javax.swing.JOptionPane;

import com.rays.sysmech.constants.StringConstants;
import com.rays.sysmech.core.FileData;
import com.rays.sysmech.listeners.StartBtnListner;


public class MButton extends JButton {

	public MButton(FileData f) {
		super(f.getName());
		this.addActionListener(new MActionListener(f));
	}

}
class MActionListener implements ActionListener
{
	FileData fileData;
	
	MActionListener(FileData f)
	{
		this.fileData = f;
	}
	
	@Override
	public void actionPerformed(ActionEvent e) {
		try 
		{
			this.fileData.openFile();
		} 
		catch (IOException exp) {
			JOptionPane.showMessageDialog(null, StringConstants.aboutInfo);
		}
		
	}
	
	}
